<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>test</title>
<script>

//1）toFixed()

var a = 10;
alert(a.toFixed(2)); 				// 返回字符串"10.00"
alert(a.toFixed(4)); 				// 返回字符串"10.0000"

//2）toExponential()

var a = 123456789;
alert(a.toExponential(2)); 		// 返回字符串"1.23e +8 "
alert(a.toExponential(4)); 		// 返回字符串"1.2346 e+8 "

//3）toPrecision()

var a = 123456789;
alert(a.toPrecision(2)); 			// 返回字符串"1.2e+ 8"
alert(a.toPrecision(4)); 			// 返回字符串"1.235 e+8"



</script>
</head>
<body>
</body>
</html> 
